API Documentation
Public Member Functions | List of all members
nkAstraeus::Material Class Referenceabstract

Base class for all materials in the component. More...

Inheritance diagram for nkAstraeus::Material:
nkAstraeus::PbsMaterial

Public Member Functions

 Material ()
 
virtual ~Material ()
 
std::string_view getName () const
 
nkGraphics::ShadergetShader () const
 
virtual MATERIAL_TYPE getType () const =0
 
void setName (const std::string_view &value)
 
virtual bool load ()=0
 
virtual void unload ()=0
 

Detailed Description

Base class for all materials in the component.

This class offers basic information and the general interface to access them.

Constructor & Destructor Documentation

◆ Material()

nkAstraeus::Material::Material ( )

Constructor.

◆ ~Material()

virtual nkAstraeus::Material::~Material ( )
virtual

Destructor.

Member Function Documentation

◆ getName()

std::string_view nkAstraeus::Material::getName ( ) const
Returns
The material's name.

◆ getShader()

nkGraphics::Shader* nkAstraeus::Material::getShader ( ) const
Returns
The final shader prepared by the material, once load() has been called.

◆ getType()

virtual MATERIAL_TYPE nkAstraeus::Material::getType ( ) const
pure virtual
Returns
The material real type. Allows to know which derived class this material truly is.

Implemented in nkAstraeus::PbsMaterial.

◆ setName()

void nkAstraeus::Material::setName ( const std::string_view &  value)

Sets the name of the material.

Parameters
valueThe name to set.
Remarks
This function is called by the MaterialManager to keep it in sync with its internal memory. If you need to alter this, please call MaterialManager::rename.

◆ load()

virtual bool nkAstraeus::Material::load ( )
pure virtual

Loads the material and make it ready for rendering.

Returns
Whether the loading went well (true) or not (false).

Implemented in nkAstraeus::PbsMaterial.

◆ unload()

virtual void nkAstraeus::Material::unload ( )
pure virtual

Unloads the material and its internal memory. After that, the material is unusable for rendering.

Implemented in nkAstraeus::PbsMaterial.


The documentation for this class was generated from the following file: